#import "dfhgwhruebvhrheygeneralizeignore.h"
#import "dfhgwhruebvhrheyspotfaint.h"
#import "dfhgwhruebvhrheyfreightencourage.h"
#import "dfhgwhruebvhrheyultimateintrinsic.h"
#import "dfhgwhruebvhrheyvacantbound.h"
@interface dfhgwhruebvhrheyvacantbound ()<dhgfywegwygeydwdefinitelyleak>
@property (nonatomic, copy) NSString *passwd;
@property (nonatomic, strong) dfhgwhruebvhrheygeneralizeignore *codeView;
@property (weak, nonatomic) IBOutlet UIView *bgView;
@property (weak, nonatomic) IBOutlet UILabel *accountNameTipsText;
@property (weak, nonatomic) IBOutlet UILabel *accountNoTipsText;
@property (weak, nonatomic) IBOutlet UILabel *amountText;
@property (weak, nonatomic) IBOutlet UILabel *termText;
@property (weak, nonatomic) IBOutlet UILabel *accountNameText;
@property (weak, nonatomic) IBOutlet UILabel *accountNoText;
@property (weak, nonatomic) IBOutlet UIView *passwdView;
@end
@implementation dfhgwhruebvhrheyvacantbound {
	CAGradientLayer *gradientLayer;
	void(^_click)(UIButton *sender, NSString *code);
}
- (void)awakeFromNib {
	[super awakeFromNib];
	self.vlineToTopHeight = 286;
	self.bgView.layer.cornerRadius = 20;
	self.bgView.layer.masksToBounds = YES;
	self.codeView = [[dfhgwhruebvhrheygeneralizeignore alloc] initWithCount:6 margin:20.0];
	self.codeView.backgroundColor = [UIColor clearColor];
	self.codeView.codeTextColor = primary_color.dhgfywegwygeydwlearneddesignate;
	self.codeView.underLineColor = @"#AAAAAA".dhgfywegwygeydwlearneddesignate;
	self.codeView.delegate = self;
	[self.passwdView addSubview:self.codeView];
	gradientLayer = [CAGradientLayer layer];
	gradientLayer.startPoint = CGPointMake(0, 0);
	gradientLayer.endPoint = CGPointMake(0, 1);
    gradientLayer.colors = @[(__bridge  id)@"#E8F3FF".dhgfywegwygeydwlearneddesignate.CGColor, (__bridge  id)[UIColor whiteColor].CGColor];
	gradientLayer.locations = @[@(0.3), @(1.0)];
	[self.bgView.layer insertSublayer:gradientLayer atIndex:0];
}
- (void)bindData:(dhgfywegwygeydwfurioussenate *)term andAmount:(dhgfywegwygeydwsenateassemble *)amount withBtnsClick:(void(^)(UIButton *sender, NSString *code))click {
	_click = click;
	self.amountText.text = [NSString stringWithFormat:@"PHP %@",amount.amount.dhgfywegwygeydwlocalitylearned];
	NSInteger time = [[NSUserDefaults standardUserDefaults] integerForKey:dhgfywegwygeydwdiagramregardless];
	NSInteger _term = [term.days intValue];
	NSInteger seconds = time + _term * 24 * 60 *60;
	self.termText.text = [dfhgwhruebvhrheyoptionsaving formatTime:seconds WithDateFormat:@"MM/dd/yyyy"];
	if(self.type == 1) {
		self.accountNameTipsText.text = @"E-Wallet";
		self.accountNoTipsText.text = @"E-Wallet Account No.";
		self.accountNameText.text = self.defaultEwalltModel.title;
		self.accountNoText.text = self.defaultEwalltModel.account_number;
	}else {
		self.accountNameTipsText.text = @"Bank Name";
		self.accountNoTipsText.text = @"Bank Account No.";
		self.accountNameText.text = self.defaultBankModel.bank_name;
		self.accountNoText.text = self.defaultBankModel.bank_number;
	}
}
- (IBAction)surePopViewBtnsClick:(UIButton *)sender {
	if (sender.tag == 101) {
		if (self.passwd.length != 6) {
			return [dfhgwhruebvhrheyoptionsaving.keyWindow show:@"Please enter the correct password"];
		}
	}
	if (_click) {
		_click(sender, self.passwd);
	}
}
- (void)layoutSubviews {
	[super layoutSubviews];
	[self.codeView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.left.equalTo(self.passwdView).offset(40);
		make.top.centerX.bottom.equalTo(self.passwdView);
	}];
	[self drawArcAndLine:nil];
	gradientLayer.frame = self.bgView.bounds;
}
- (void)codeViewDidInputCompleted:(dfhgwhruebvhrheygeneralizeignore *)codeView {
	self.passwd = codeView.code;
}
@end
